package com.demo.dao;

import com.demo.entity.Role;
import com.demo.vo.RolePermissionUnion;

import java.util.List;

public interface IRoleDao {
    int deleteByPrimaryKey(Integer id);

    int insert(Role record);
    List<Role> queryAll();
    int insertSelective(Role record);
    int selectId();

    Role selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Role record);

    int updateByPrimaryKey(Role record);
    /**
     * get roles by userid
     * @param userid
     * @return
     */
    List<Role> getRolesByUserID(int userid);
    List<Role> getRoleList(Role role);

    /**
     * 获取用户角色
     * @param userid
     * @return
     */
    List<Role> getUserRoleByUserId(int userid);
    List<RolePermissionUnion> queryAllRoleWithPermission();
}